<script setup lang="ts">
// import { ref } from "vue";
import RTK from '@/assets/bit-screen/schedule-mge/RTK.png'
import GPS from '@/assets/bit-screen/schedule-mge/GPS.png'
import speed from '@/assets/bit-screen/schedule-mge/speed.png'
import HD from '@/assets/bit-screen/schedule-mge/HD.png'
import battery from '@/assets/bit-screen/schedule-mge/battery.png'
import voltage from '@/assets/bit-screen/schedule-mge/voltage.png'
// import borderbg from '@/assets/bit-screen/schedule-mge/borderbg.png'
const weatherList = [
  { name: 'RTK星级', img: RTK, value: '0', unit: '' },
  { name: 'GPS信号', img: GPS, value: '0', unit: '' },
  { name: '水平速度', img: speed, value: '30', unit: 'm/s' },
  { name: '垂直速度', img: speed, value: '30', unit: 'm/s' },
  { name: '无人机高度', img: speed, value: '30', unit: 'm' },
  { name: '图传信号', img: HD, value: '30', unit: '%' },
  { name: '电池电量', img: battery, value: '0', unit: '%' },
  { name: '电池电压', img: voltage, value: '0', unit: 'V' }
]
</script>

<template>
  <div class="data-monitor-box">
    <div class="content-box">
      <div class="item-box" v-for="(item, index) in weatherList" :key="index">
        <img :src="item.img" alt="" />
        <div class="right">
          <p class="title">{{ item.name }}</p>
          <p class="value">{{ item.value }} {{ item.unit }}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<style lang="less" scoped>
* {
  padding: 0;
  margin: 0;
}

.data-monitor-box {
  height: 100%;
  .content-box {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    height: 100%;
    .item-box {
      width: 48%;
      display: flex;
      margin-bottom: 3px;
      height: 42px;
      &:last-child {
        margin-bottom: 0 !important; // 将最后一个 .item-box 的 margin-bottom 设置为 0
      }

      .title {
        font-size: 12px;
        color: #3f8afc;
        background: linear-gradient(0deg, #5BB8ED 0%, #FFFFFF 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
      }

      img {
        width: 42px;
        height: 42px;
        margin-right: 3px;
      }
      .right {
        flex: 1;
        margin-left: 6px;
        background: url('@/assets/bit-screen/schedule-mge/databg.png') no-repeat center;
        border: 1px solid #366fd1;
        padding: 2px 11px;
        overflow: hidden;
        .value {
          font-size: 15px;
          color: #73a9cb;
          font-weight: bold;
          background: linear-gradient(0deg, #D5F6FF 0%, #6AC5FF 100%);
          -webkit-background-clip: text;
          // height: 15px;
          -webkit-text-fill-color: transparent;
        }
      }
    }
  }
}

/* 当视口高度大于或等于880px时，应用这些样式 */
@media screen and (min-height: 950px) {
  .data-monitor-box {
    padding-top: 15px;
  }
  .data-monitor-box .content-box .item-box {
    color: red !important; /* 你的颜色修改，用于调试 */
    height: 50px;
    margin-bottom: 8px;
  }
  img {
    width: 50px !important;
    height: 50px !important;
    margin-right: 6px;
  }
}
</style>
